import request from "../utils/request.js";


export async function addSensitiveWord(SensitiveWord, callback) {
    await request.get('/sensitive-word/addSensitiveWord', {
        params:{
            sensitiveWord:SensitiveWord.word
        }
    }).then((result) => {
        callback(result)
    })
}

export async function deleteById(id,callback) {
    await  request.post(`/sensitive-word/delete/${id}`).then(result=>{
        callback(result)
    })
}


export async function deleteByIds(ids,callback) {
    await  request.post('/sensitive-word/deleteByIds',ids).then(result=>{
        callback(result)
    })
}

export async function updateSensitiveWord(sensitiveWord,callback) {
    await  request.post(`/sensitive-word/update`,sensitiveWord).then(result=>{
        callback(result)
    })
}


export async function sensitiveWordPageListAndSearch(sensitiveWord,callback) {
    await  request.get('/sensitive-word/searchAndPageList',{
        params: {
            searchText:sensitiveWord.word,
            pageSize:sensitiveWord.pageSize,
            pageNumber:sensitiveWord.pageNo
        }
    }).then((result)=>{
        callback(result)
    })
}


export async function searchSensitiveWord(sensitiveId,callback) {
    await  request.post(`/sensitive-word/getSensitiveById/${sensitiveId}`).then(result=>{
        callback(result)
    })
}
